gusucode.com > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM源码程序 > 支持向量机工具箱 - LIBSVM OSU_SVM LS_SVM\stprtool\datasets\ascii2xi.m
function [X,I] = ascii2xi(datafile,labelfile,dlm) % ASCII2XI loads data from ASCII files. % [X,I] = ascii2xi(datafile,labelfile,dlm) % % ACII2XI loads labeled data from ASCII files of % following format: % Data file 'datafile': % - each row corresponds to one pattern. % - each columns corresponds to one feature. % - columns are separated by given delimiter 'dlm' % (blank space is default). % % File of labels 'labelfile': % - contains one column of integers corresponding to % rows in the data file. % % Input: % datafile [string] data file. % labelfile [string] file with labels. % % Output: % X [D x M] matrix containing loaded patterns, where D is % dimenssion and M is the number of patterns. % I [1 x M] vector containing labels. % % See also DATAFILES, DATASETS. % % Statistical Pattern Recognition Toolbox, Vojtech Franc, Vaclav Hlavac % (c) Czech Technical University Prague, http://cmp.felk.cvut.cz % Written Vojtech Franc (diploma thesis) 02.01.2000 % Modifications % 25-September-2001, V. Franc, 'See also' added. % 11-June-2001, V.Franc if nargin < 3, dlm =' '; end X = dlmread( datafile, dlm)'; I = dlmread( labelfile )'; return;